package zq.cn.utils;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by ZQ on 2016/4/18.
 */
public class Sqlite extends SQLiteOpenHelper{
    private static final int VERSION=1;
    private static final String SQLNAME="MySQLite";
    public Sqlite(Context context) {
        super(context,SQLNAME,null,VERSION);
    }

    public Sqlite(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        String sql = "create table txt_tab(" +
                "  id integer primary key," +
                "  question text," +
                "  answer text)";
        db.execSQL(sql);
    }

    //版本信息更改后再此方法中改
    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
